import { axiosGet, axiosPost, axiosPut, axiosDelete } from '/@/api/RequestBase';
import { SqlSugarPagedList, BaseKeywordPageInput } from '/@/api/BaseDto';

import { TraPeiXueInput } from './dto/TraPeiXueInput';
import { TraPeiXueOutput } from './dto/TraPeiXueOutput';
import { TraPeiXueMingXiInput } from './dto/TraPeiXueMingXiInput';
import { TraPeiXueMingXiOutput } from './dto/TraPeiXueMingXiOutput';
import { TraShenQingPeiXueAllOutDto } from './dto/TraShenQingPeiXueAllOutDto';
import { TraPeiXueAllDto } from './dto/TraPeiXueAllDto';

export type { TraPeiXueInput, TraPeiXueOutput, TraPeiXueMingXiInput, TraPeiXueMingXiOutput, TraShenQingPeiXueAllOutDto, TraPeiXueAllDto };

const service = 'traPeiXue/'; // 要写后面的斜杠, 不要写前面的斜杠

export const TraPeiXueApi = {
	page: (data: BaseKeywordPageInput) => {
		return axiosPost<SqlSugarPagedList<TraPeiXueOutput>>(service + 'page', data);
	},
	get: (id: number | string) => {
		return axiosGet<TraShenQingPeiXueAllOutDto>(service + `get/${id}`);
	},
	add: (data: TraPeiXueAllDto) => {
		return axiosPost<TraPeiXueOutput>(service + 'add', data);
	},
	update: (data: TraPeiXueInput) => {
		return axiosPut<boolean>(service + 'update', data);
	},
	getPeiXueBloodExists: (id: number) => {
		return axiosGet<Array<string>>(service + `getPeiXueBloodExists/${id}`);
	},
};
